package com.kaochong.xcx.dao;

import com.kaochong.xcx.entity.Word;

import org.springframework.data.repository.query.Param;

import java.util.List;

public interface WordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Word record);

    int insertSelective(Word record);

    Word selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Word record);

    int updateByPrimaryKeyWithBLOBs(Word record);

    int updateByPrimaryKey(Word record);
	
    /**********自定义方法**************/
    /**
     * 根据单词书和阶段查询
     * @param wordType
     * @param stage
     * @return
     */
	List<Word> findByWordTypeAndStage(@Param("wordType") Integer wordType, @Param("stage") Integer stage);
    
    /**
     * 查某本单词书所有词性
     * @param wordType
     * @return
     */
    List<String> selectWordSex(Integer wordType);
    
    /**
     * 查找某本单词书某个词性的单词
     * @param wordType
     * @param enSex
     * @return
     */
    List<Word> findByWordTypeAndEnSex(@Param("wordType") Integer wordType, @Param("enSex") String enSex);
    
    /**
     * 查询单词书所有单词
     * @param wordType
     * @return
     */
    List<Word> selectByWordType(Integer wordType);
}